package models

// 自定义关联表
type Menu2ImageModel struct {
	MenuID  uint `gorm:"primary_key"`
	ImageID uint `gorm:"primary_key"`
	Sort    int  `gorm:"size:6"` // 默认 smallint(6) gorm设置无效果gorm:"size:10"无效 smallint不支持10
	// 不属于表结构
	ImageModel ImageModel `gorm:"foreignKey:ImageID"`
	MenuModel  MenuModel  `gorm:"foreignKey:MenuID"`
}

func (Menu2ImageModel) TableName() string {
	return "menu2_image"
}
